package com.xiaojianhx.demo.data_structure;

import java.util.HashMap;
import java.util.List;

/**
 * Algorithm Sort 01 BubbleSort
 * 
 * @author xiaojianhx
 * @version V1.0.0 $ 2021-04-18 23:47:23 init ---- xiaojianhx
 */
public class DataStructure_RBTree {

    public static void main(String[] args) {

        var node = new Node<String>();
        node.setValue("A");
        System.out.println(node);

        var map = new HashMap<>();
        for (var i = 0; i < 100; i++) {
            map.put(i + "a", i);
        }
    }
}

class Node<T> {

    private T value;
    private Node<T> parent;
    private List<Node<T>> left;
    private List<Node<T>> right;
    private boolean red;

    public T getValue() {
        return value;
    }

    public void setValue(T value) {
        this.value = value;
    }

    public Node<T> getParent() {
        return parent;
    }

    public void setParent(Node<T> parent) {
        this.parent = parent;
    }

    public List<Node<T>> getLeft() {
        return left;
    }

    public void setLeft(List<Node<T>> left) {
        this.left = left;
    }

    public List<Node<T>> getRight() {
        return right;
    }

    public void setRight(List<Node<T>> right) {
        this.right = right;
    }

    public boolean isRed() {
        return red;
    }

    public void setRed(boolean red) {
        this.red = red;
    }

    public String toString() {
        return "{" + value + ", red: " + red + ", left: " + left + ", right: " + right + "}";
    }
}